package com.isunland.managesystem.adapter;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseButterKnifeAdapter;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.KnowledgeAnnounceList.KnowledgeAnnounceDetail;
import java.util.ArrayList;

public class KnowledgeAnnounceListAdapter extends BaseButterKnifeAdapter<KnowledgeAnnounceDetail> {

  public KnowledgeAnnounceListAdapter(BaseVolleyActivity context,
      ArrayList<KnowledgeAnnounceDetail> objects) {
    super(context, objects);
  }

  @Override protected int setLayoutId() {
    return R.layout.adapter_company_event;
  }

  @NonNull @Override protected BaseViewHolder initHolder(View convertView) {
    return new ViewHolder(convertView);
  }

  @Override
  protected void initView(KnowledgeAnnounceDetail item, BaseViewHolder baseHolder, int position) {
    ViewHolder vh = (ViewHolder) baseHolder;
    vh.tvType.setText(item.getDocKindName());
    vh.tvBrief.setText(item.getNoticeTitle());
    vh.tvNumber.setText(item.getDocKnowledgeNo());
    vh.tvName.setText(item.getRegStaffName());
    vh.tvDate.setText(item.getCheckDate());
  }

  @Override public boolean isEmpty() {
    return false;
  }

  protected class ViewHolder extends BaseViewHolder {
    @BindView(R.id.tv_type) TextView tvType;
    @BindView(R.id.tv_brief) TextView tvBrief;
    @BindView(R.id.tv_number) TextView tvNumber;
    @BindView(R.id.tv_name) TextView tvName;
    @BindView(R.id.tv_date) TextView tvDate;

    ViewHolder(View view) {
      super(view);
    }
  }
}